home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / File::stat.Z / File::stat
Encoding:
Text File  |  1998-10-28  |  2.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))   22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))     FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       File::stat - by-name interface to Perl's built-in _s_t_a_t()
  10.       functions
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.        use File::stat;
  14.        $st = stat($file) or    die "No    $file: $!";
  15.        if (    ($st->mode & 0111) && $st->nlink > 1) )    {
  16.            print "$file is executable with lotsa links\n";
  17.        }
  18.  
  19.        use File::stat qw(:FIELDS);
  20.        stat($file) or die "No $file: $!";
  21.        if (    ($st_mode & 0111) && $st_nlink > 1) ) {
  22.            print "$file is executable with lotsa links\n";
  23.        }
  24.  
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.       This module's    default    exports    override the core _s_t_a_t() and
  28.       _l_s_t_a_t() functions, replacing them with versions that return
  29.       "File::stat" objects.     This object has methods that return
  30.       the similarly    named structure    field name from    the _s_t_a_t(2)
  31.       function; namely, dev, ino, mode, nlink, uid,    gid, rdev,
  32.       size,    atime, mtime, ctime, blksize, and blocks.
  33.  
  34.       You may also import all the structure    fields directly    into
  35.       your namespace as regular variables using the    :FIELDS    import
  36.       tag.    (Note that this    still overrides    your _s_t_a_t() and
  37.       _l_s_t_a_t() functions.)  Access these fields as variables    named
  38.       with a preceding st_ in front    their method names.  Thus,
  39.       $stat_obj->dev() corresponds to $st_dev if you import    the
  40.       fields.
  41.  
  42.       To access this functionality without the core    overrides,
  43.       pass the use an empty    import list, and then access function
  44.       functions with their full qualified names.  On the other
  45.       hand,    the built-ins are still    available via the CORE::
  46.       pseudo-package.
  47.  
  48.      NNNNOOOOTTTTEEEE
  49.       While    this class is currently    implemented using the
  50.       Class::Struct    module to build    a struct-like class, you
  51.       shouldn't rely upon this.
  52.  
  53.      AAAAUUUUTTTTHHHHOOOORRRR
  54.       Tom Christiansen
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))   22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))     FFFFiiiilllleeee::::::::ssssttttaaaatttt((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.      Page 2                        (printed 10/23/98)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.